package _Pan3D.program.shaders
{
	import _Pan3D.program.Shader3D;
	
	public class ShadowShader extends Shader3D
	{
		public static var SHADOWSHADER:String = "shadowshader";
		public function ShadowShader()
		{
			vertex = 
				"m44 vt0, va0, vc4 \n" +
				"m44 vt1, vt0, vc0 \n" +
				"m44 vt5, va0, vc8 \n" +
				
				"mov op, vt1 \n" +
				"mov v0, va1 \n" + 
				"mov v5, vt5 \n" +
				"mov v2, va2";
				
			fragment =
			
				"tex ft0, v0, fs1 <2d,clamp,repeat>\n"+
				
				"mov ft5,v5\n"+
				"neg ft5.z,ft5.z \n"+
				"div ft5,ft5,ft5.z \n"+
				"neg ft5.y,ft5.y \n"+
				"add ft5,ft5,fc2.z \n"+
				"tex ft5, ft5, fs2 <2d,clamp,repeat>\n"+
				"mul ft0,ft0,ft5\n"+
				
				"dp3 ft2.x,fc0,v2\n"+
				"mul ft2.x,ft2.x,fc1.w\n"+
				"mul ft2,ft0,ft2.x\n"+
				"add ft0,ft0,ft2\n"+
				"add ft0,ft0,fc1\n"+
				"mov oc, ft0"
				
				/*
				"mov ft6,v2\n"+
				
				"mov ft1,ft0\n"+
				"mov ft3,fc0\n"+
				"mov ft2,fc0\n"+
				
				"dp3 ft2.x,ft3,ft6\n"+
				"dp3 ft2.y,ft3,ft3\n"+
				"dp3 ft2.z,ft6,ft6\n"+
				
				"sqt ft2.y,ft2.y\n"+
				"sqt ft2.z,ft2.z\n"+
				"div ft2.x,ft2.x,ft2.y\n"+
				"div ft2.x,ft2.x,ft2.z\n"+
				
				"mul ft2.x,ft2.x,fc1.w\n"+
				"mul ft2,ft1,ft2.x\n"+
				"add ft1,ft1,ft2\n"+
				
				"add ft1.x,ft1.x,fc1.x\n"+
				"add ft1.y,ft1.y,fc1.y\n"+
				"add ft1.z,ft1.z,fc1.z\n"+
				*/
				//"mov oc, ft1";
				
		}
	}
}